<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>盒子模型</title>

    <style>

        div {
            width: 200px;
            height: 200px;
            background-color: pink;
            border: 20px solid red;
            padding: 15px;
            box-sizing: content-box;
        }

        p {
            width: 200px;
            height: 200px;
            background-color: pink;
            border: 20px solid red;
            padding: 15px;
            box-sizing: border-box;
        }

    </style>

</head>
<body>
    <img src="盒子模型border-box.png" alt="">
    <br><br>

    <div>box-sizing: content-box 默认 会被撑大</div>
    <p>box-sizing: border-box 大小就是width height所指定会不被撑大</p>
    
</body>
</html>